package com.d0325;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;

public class TestMassageFormat {
    public static void main(String[] args) {
       // String pattern="{0}您好，应付金额为{1}";
        try{
        FileReader fr=new FileReader("src/com/d0325/message.properties");
        Properties properties=new Properties();
        properties.load(fr);
        String pattern=properties.getProperty("pattern");
        System.out.println(MessageFormat.format(pattern,new Object[]{"zhangsan",123}));
        System.out.println(MessageFormat.format(pattern,new Object[]{"lisi",32}));
    }catch (FileNotFoundException e){
            e.printStackTrace();
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
